#!/usr/bin/python3
# coding=UTF-8

import time
import robomaster
from robomaster import conn
from MyQR import myqr
from PIL import Image
import cv2
import numpy as np
import rospy
import roslaunch

if __name__ == '__main__':
    helper = conn.ConnectionHelper()
    info = helper.build_qrcode_string(ssid="ztxiaomi", password="zt123456")
    # info = helper.build_qrcode_string(ssid="cunningWIFI", password=" ")
    myqr.run(words=info)
    time.sleep(1)
    if helper.wait_for_connection():
        print("Connected!")
    else:
        print("Connect failed!")